import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Chrome()
url = 'https://www.taobao.com/'
driver.maximize_window()
driver.get(url)
time.sleep(3)

"""
鼠标悬浮目录才会出来
"""
element = driver.find_element(By.XPATH, '//*[@id="J_SiteNavSeller"]/div[1]')
ActionChains(driver).move_to_element(element).perform()  # 使鼠标悬浮在指定元素上

# 获取到所有元素
element = driver.find_element(By.XPATH, '//*[@id="J_SiteNavSeller"]/div[2]/div')
All_elements = element.find_elements(By.TAG_NAME, 'a')
for i in All_elements:
    print(i.text)

print('ending...')